<!DOCTYPE html>
<html lang="en"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.thymeleaf.org"
      layout:decorator="layout/pc_master">
<div layout:fragment="content" class="section page-content">
<!--    <link rel="stylesheet" href="/pc/css/center/setmeal/info.js">-->
    <!-- s: 导航 -->
    <div class="breadcrumb-wrap">
        <div class="layui-main clearfix">
            <div class="breadcrumb">
                <a href="/">首页</a> - <a href="/center">用户中心</a> - 联系方式
            </div>
        </div>
    </div>
    <style type="text/css">
        .wechatcodebox { line-height: 1; text-align: center; display: inline-block; }
        .wechatcode { cursor: pointer; }
    </style>
    <!-- e: 导航 -->
    <div class="section page-content">
        <div class="layui-main clearfix">

         <div th:include="layout/center_left :: center_left" class="manage-aside"></div>

            <div class="manage-main">
                <ul class="layui-nav nav main-nav">
                    <li class="layui-nav-item layui-this">
                        <a href="/center/contact/contact">
                            我的联系方式
                        </a>
                    </li>
                    <li class="layui-nav-item">
                        <a href="/center/contact/mycontact">
                            我申请的
                        </a>
                    </li>
                    <li class="layui-nav-item">
                        <a href="/center/contact/contactme">
                            申请我的
                        </a>
                    </li>

                    <span class="layui-nav-bar" style="left: 20px; top: 57px; width: 0px; opacity: 0;"></span></ul>
                <div class="main-content">
                    <form bottlecms-form-ajax="" method="post" id="form_contact"
                          onsubmit="return checkContact()">
                        <input type="hidden" name="_method" value="PUT">
                        <div class="layui-form-item">
                            <label class="layui-form-label">微信号：</label>
                            <div class="layui-input-inline">
                                <input bottlecms-input type="text" name="wechatid" id="wechatid"
                                       th:value="${data.wechatid}"
                                       placeholder="请输入微信号" class="layui-input" maxlength="50">
                            </div>
                            <div class="layui-word-aux">

                                <input bottlecms-input type="hidden" name="wechatQrcode" id="wechatQrcode"
                                       th:value="${data.wechatQrcode}"/>

                                <div class="wechatcodebox ">
                                    <div class="wechatcode" id="wechatcode">
                                        <svg t="1576654359887" class="icon" style="width: 30px;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M117.36826016 487.44484823l371.92033828 2e-8L489.28859844 115.52540996 117.36826016 115.52540996 117.36826016 487.44484823zM210.34901972 208.50526953l185.95971915 0-1e-8 185.95971914L210.34901972 394.46498867 210.34901972 208.50526953zM535.77897822 115.52540996l1e-8 371.92033829 371.92033828 0L907.69931562 115.52540996 535.77897822 115.52540996zM814.71855693 394.46498867L628.75883779 394.46498867 628.75883779 208.50526953l185.95971914 0L814.71855693 394.46498867zM256.83849951 347.97550887l92.97985957 2e-8L349.81835908 254.99474932 256.83849951 254.99474932 256.83849951 347.97550887zM117.36826016 905.85556631l371.92033828 0L489.28859844 533.93522803 117.36826016 533.93522803 117.36826016 905.85556631zM210.34901972 626.91508761l185.95971915-2e-8-1e-8 185.95971915L210.34901972 812.87480674 210.34901972 626.91508761zM768.22907627 254.99474932L675.24831758 254.99474932l0 92.97985955 92.97985956 0L768.22817715 254.99474932zM535.77897822 905.85556631l92.97985957 0L628.75883779 812.87570586 535.77897822 812.87570586 535.77897822 905.85556631zM628.75883779 626.91508761l0 185.95971913 92.97985958 0L721.73869737 626.91508761 628.75883779 626.91508761zM814.71855693 812.87570586L721.73869737 812.87570586 721.73869737 905.85556631l185.95971914 0L907.69841651 719.89494717 814.71855693 719.89494717 814.71855693 812.87570586zM814.71855693 626.91508761l92.97985958-2e-8L907.69841651 533.93522803 814.71855693 533.93522803 814.71855693 626.91508761zM535.77897822 533.93522803l1e-8 92.97985956 92.97985956 2e-8L628.75883779 533.93522803 535.77897822 533.93522803zM256.83849951 766.38532695l92.97985957 0L349.81835908 673.40546738 256.83849951 673.40546738 256.83849951 766.38532695z"></path></svg>
                                    </div><input class="layui-upload-file" type="file" accept="undefined" name="file">
                                    <font style="font-size: 12px;">上传二维码</font>
                                </div>
                            </div>
                        </div>


                        <div class="layui-form-item">
                            <label class="layui-form-label">邮箱：</label>
                            <div class="layui-input-inline">
                                <input bottlecms-input type="text" name="email" id="email"
                                       th:value="${data.email}"
                                       placeholder="请输入邮箱" class="layui-input">
                            </div>
                            <div class="layui-form-mid layui-word-aux"></div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">电话：</label>
                            <div class="layui-input-inline">
                                <input bottlecms-input type="number" name="phone" id="phone"
                                       th:value="${data.phone}"
                                       placeholder="请输入电话号" class="layui-input">
                            </div>
                            <div class="layui-form-mid layui-word-aux"></div>
                        </div>



                        <div class="layui-form-item">
                            <label class="layui-form-label">审核状态：</label>
                            <div class="layui-input-inline">
                                <font th:if="${data.isCheck} eq 3" class="array_check_3">
                                    待审核
                                </font>
                                <font th:if="${data.isCheck} eq 2" class="array_check_2">
                                    审核拒绝
                                </font>
                                <font th:if="${data.isCheck} eq 1" class="array_check_1">
                                    审核通过
                                </font>
                            </div>
                            <div class="layui-form-mid layui-word-aux"></div>
                        </div>


                        <div class="layui-form-item" style="margin-top: 50px;">
                            <div class="layui-input-block">
                                <button class="layui-btn layui-btn-default layui-btn-radius layui-btn-lg " lay-submit="">确认提交</button>
                            </div>
                        </div>

                    </form>

                    <br>
                    <hr>
                    <p style="color: #999">
                        注：每次提交都需要审核，请谨慎修改.
                    </p>


                </div>

            </div>

        </div>
    </div>





</div>
<div layout:fragment="contentFooter">
    <script type="text/javascript">


        function sxqrcode(){
            var codetext = $('input[name="wechat_qrcode"]').val();
            if(codetext){
                $("#wechatcode").html("");
                $("#wechatcode").qrcode({
                    render: "canvas", //table方式
                    width: 30, //宽度
                    height:30, //高度
                    text: codetext //任意内容
                });
            }

        }
        $(document).ready(function($) {
            sxqrcode();
        });


        bottlecms.layuiuploadfile({
            elem:".wechatcode",
            success:function(pic){
                var loadingobj = bottlecms.loading("识别中…");
                bottlecms.put('',{qrcode:pic},function(data){
                    bottlecms.log(data)
                    loadingobj.close();
                    if (data.success == true) {
                        $('input[name="wechat_qrcode"]').val(data.obj);
                        sxqrcode();
                    } else {
                        bottlecms.toast(data.msg);
                    }
                })
            }
        });

    </script>


</div>
</html>